package com.athenaeum.datastore.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.athenaeum.datastore.domain.User;
import com.athenaeum.datastore.repository.UserRepository;
import com.athenaeum.datastore.service.UserService;

@Service
public class UserServiceImpl implements UserService {

	@Resource
	private UserRepository userRepository;

	@Override
	public User save(User user) {
		return userRepository.save(user);
	}

	@Override
	@Transactional(readOnly = true)
	public User findOne(String id) {
		return userRepository.findOne(id);
	}

	@Override
	public Iterable<User> findAll() {
		return userRepository.findAll();
	}
}
